package com.xfcy.blog.controller.system;



import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.xfcy.blog.annotation.OperationLogger;
import com.xfcy.blog.common.R;
import com.xfcy.blog.service.FeedBackService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * (FeedBack)表控制层
 *
 * @author 晓风残月Lx
 * @since 2023-04-09 11:03:05
 */
@RestController
@RequestMapping("system/feedback")
@Api(tags = "反馈管理")
public class FeedBackController {

    @Resource
    private FeedBackService feedBackService;


    @ApiOperation(value = "后台反馈列表", httpMethod = "GET", response = R.class, notes = "后台反馈列表")
    @GetMapping("/list")
    @SaCheckLogin
    public R list(Integer pageNo, Integer pageSize, Integer type) {
        return feedBackService.listFeedBack(pageNo, pageSize, type);
    }

    @OperationLogger(value = "批量删除反馈")
    @ApiOperation(value = "批量删除反馈", httpMethod = "DELETE", response = R.class, notes = "批量删除反馈")
    @DeleteMapping("/deleteBatch")
    @SaCheckPermission("/system/feedback/deleteBatch")
    public R deleteBatch(@RequestBody List<Integer> ids) {
        return feedBackService.deleteBatchFeedBack(ids);
    }

}

